
%overloaded forces (N)
fid = fopen('force_over.txt');
Fz_1 = fscanf(fid, '%f');
fclose(fid);

%Nominal forces (N)
fid = fopen('force_nominal.txt');
Fz_2 = fscanf(fid, '%f');
fclose(fid);

%slack
fid = fopen('slack.txt');
Fslack = fscanf(fid, '%f');
fclose(fid);

%1 (N)
fid = fopen('1.txt');
T1 = fscanf(fid, '%f');
fclose(fid);


%2(N)
fid = fopen('2.txt');
T2 = fscanf(fid, '%f');
fclose(fid);


%3(N)
fid = fopen('3.txt');
T3 = fscanf(fid, '%f');
fclose(fid);

%4 (N)
fid = fopen('4.txt');
T4= fscanf(fid, '%f');
fclose(fid);

%5 (N)
fid = fopen('5.txt');
T5= fscanf(fid, '%f');
fclose(fid);



%toques at elbow:
l_h = 0.11; %[m]

tau_over = Fz_1.*l_h;
tau_nominal = Fz_2.*l_h;

T_slack = abs(Fslack*l_h);

%Post-processing
p = length(T_slack);
for i=1:1500  
    if T_slack(i) > 0.015
            T_slack2(i) = 0.015;
    else
            T_slack2(i) = T_slack(i);
    end
    
end

%Post-processing
cont = 1;
for i=1500:3000  
    if T_slack(i) > 0.005
            T_slack3(cont) = 0.005;
            cont = cont +1;
    else
            T_slack3(cont) = T_slack(i);
            cont = cont +1;
    end
    
end



T1_1 = T1.*l_h;
T2_1 = T2.*l_h;
T3_1 = T3.*l_h;
T4_1 = T4.*l_h;
T5_1 = T5.*l_h;
